//
//  @ Project : Galaxy Star Trading System
//  @ File Name : LTSTradeApi.h
//  @ Date : 2014/9/5
//  @ Author :
//
//


#if !defined(_LTSTRADEAPI_H_H)
#define _LTSTRADEAPI_H_H

#ifdef BUILD_LTS

#include "api/SecurityFtdcTraderApi.h"
#include "api/SecurityFtdcUserApiDataType.h"
#include "api/SecurityFtdcUserApiStruct.h"

namespace GSTrader
{
	namespace TradeService
	{
		class CLtsTradeSpiImpl;
		class TRADE_SERVICE_API CLtsTradeApi : public CTradeApi
		{
		public:
			CLtsTradeApi();
			virtual ~CLtsTradeApi();

			virtual int Init(TradeApiConnParam& param);
			virtual void Destory();

			virtual int ReqUserLogin();
			virtual int ReqQryOrder();
			virtual int ReqQryTrade();
			virtual int ReqUserLogOut();
			virtual int ReqQryExchange(string strExchangeID);
			virtual int ReqQryDepthMarketData(string strInstrumentID);

			virtual int ReqQryInvestorPosition(string strInstrumentID);
			virtual int ReqQryTradingAccount();
			virtual int ReqQryInstrument(string strInstrumentID);
			virtual int ReqQryInstrumentMarginRate(string strInstrumentID, char chHedgeFlag);
			virtual int ReqQryInstrumentCommissionRate(string strInstrumentID);

			virtual int ReqQryInvestor();
			virtual int ReqQryTradingCode();
			virtual int ProcessRequestMsg(CMsg* pMsg);

		public:
			virtual int ReqOrderInsert(COrder* pOrder);
			virtual int ReqOrderAction(COrder& srcOrder);

		public: // δʵ�ֵ�

			virtual int ReqParkedOrderInsert(COrder* pOrder)
			{
				return 0;
			}
			virtual int ReqParkedOrderAction()
			{
				return 0;
			}
			virtual int ReqQrySettlementInfo(string strTradingDay)
			{
				return 0;
			}
			virtual int ReqSettlementInfoConfirm()
			{
				return 0;
			}
			virtual int ReqQrySettlementInfoConfirm()
			{
				return 0;
			}
			virtual int ReqQryInvestorPositionDetail(string strInstrumentID)
			{
				return 0;
			}
			virtual int ReqQryInvestorPositionCombineDetail(string strInstrumentID)
			{
				return 0;
			}
			virtual int ReqQryNotice()
			{
				return 0;
			}
			virtual int ReqQueryMaxOrderVolume()
			{
				return 0;
			}
			virtual int ReqQryBrokerTradingParams()
			{
				return 0;
			}
			virtual int ReqQryBrokerTradingAlgos(string strExchangeID, string strInstrumentID)
			{
				return 0;
			}
			virtual int ReqQryComplianceParam(string strExchangeId)
			{
				return 0;
			}
		private:

			CLtsTradeSpiImpl* m_pSpiImpl;
			CSecurityFtdcTraderApi* m_pTradeApi;

		private:
			friend class CLtsTradeSpiImpl;
			friend class CLtsDataBaseHelper;
		};
	}
}

#endif 

#endif //_LTSTRADEAPI_H_H
